package com.oron3.bouncer.interaction;



public class ZoomEvent extends InteractiveEvent{

	private float zoomByFactor = -1;

	public ZoomEvent(final InteractionInterpreter interpreter,final int zoomAmount) {
		super(interpreter,-1, -1);
		this.zoomAmount = zoomAmount;
	}
	public ZoomEvent(final InteractionInterpreter interpreter,final int zoomAmount,final boolean fixedZoom) {
		super(interpreter,-1, fixedZoom?0:-1);
		this.zoomAmount = zoomAmount;
	}
	public ZoomEvent(final InteractionInterpreter interpreter, final int x, final int y,final int zoomAmount) {
		super(interpreter,x, y);
		this.zoomAmount = zoomAmount;
	}

	public ZoomEvent(final InteractionInterpreter interpreter,final float zoomFactor) {
		super(interpreter,-1, -1);
		zoomByFactor = zoomFactor;
	}

	private int zoomAmount;

	public int getZoomAmount() {
		return zoomAmount;
	}

	public void setZoomAmount(final int zoomAmount) {
		this.zoomAmount = zoomAmount;
	}

	public boolean isZoomToPosition() {
		return x>=0 && y>=0;
	}
	/**
	 * is this zoom event came from the zoom button?
	 * @return
	 */
	public boolean isFixedZoom() {
		return x<0 && y!=-1;
	}
	public float getZoomFactor() {
		return zoomByFactor;
	}
	public boolean isZoomByFactor() {
		return zoomByFactor>=0.0;
	}
	public void setZoomFactor(final float zoomFactor) {
		zoomByFactor=zoomFactor;
	}

}
